<template>
  <div class="app">
    <h2>我是App组件</h2>
    <h3>子给我的玩具：{{ wanju }}</h3>
    <br>
    <Child :sendToy="getToy"/>
  </div>
</template>

<script>
  import Child from './components/Child.vue'

  export default {
    name:'App',
    components:{Child},
    data() {
      return {
        wanju:''
      }
    },
    methods: {
      getToy(value){
        this.wanju = value
      }
    },
  }
</script>

<style>
  .app {
    background-color: #ddd;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
  }
</style>